Repository navigation
Harden the backend for autoscaling - #1
Open
Mehulsri07 wants to merge 12 commits into
Open
Mehulsri07 wants to merge 12 commits into
Mehulsri07 wants to merge 12 commits into
Conversation
…gauge Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eady probes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ven fault injection Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…leanup, CI Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
burnCPU spun until a wall-clock deadline, so under contention a request used less than WORK_CPU_MS of CPU and measured capacity depended on load. It now runs a fixed number of xorshift iterations, calibrated once at startup (and lazily via sync.Once for tests). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With /work now burning a calibrated 20ms of CPU per request, one 1 CPU / 128 MiB pod holds the 200ms p95 SLO up to 40 rps; at 50 rps (100% of the CPU budget) the queue grows without bound. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nt /work) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…config, name pod in admin - Apply FaultMiddleware per route inside Instrument so injected 500s and latency reach http_requests_total and the duration histogram. - Calibrate CPU as the fastest of 10 5ms windows; the single 50ms average read 0.23-0.40 of idle speed on a busy node, bringing back capacity drift. - Treat NaN like an unparsable config value: default plus one warning. - Include the pod hostname in POST /admin/leak and /admin/leak/stop responses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lt routing fixes Still 40 rps per pod at the 200 ms p95 SLO. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes the backend safe to autoscale, as the workload for Horizon Lab (Phase 1).
/livez,/readyz, cancellable/slowand/cpu, and/workwith a fixed, calibrated CPU cost.build_info{version}. Injected faults are recorded in the metrics.:9091) only. A:badimage injects latency and errors.scripts/capacity.pymeasured 40 rps per pod at 1 CPU / 128 MiB (results/capacity.json).Test plan
go vetandgo test -count=5pass locally (without-race, which is unavailable on the dev machine):badfails about 10% of requests and adds 300 ms or more/api/health,/api/infoand/api/statusreturn 200go test -raceand the image builds pass in CI (first run of this workflow)Known gaps
🤖 Generated with Claude Code